package com.kylin.cmsservice.controller;

import com.kylin.R;
import com.kylin.cmsservice.entity.CrmBanner;
import com.kylin.cmsservice.service.CrmBannerService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/educms/bannerfront")
@CrossOrigin
public class BannerFrontController {

    @Autowired
    CrmBannerService bannerService;


    //查询所有Banner
    @GetMapping("/getAllBanner")
    @ApiOperation("查询所有Banner")
    public R getAllBanner(){

        List<CrmBanner> list = bannerService.selectAllBanner();
        return R.ok().data("list",list);
    }
}
